package com.ang.publishEvent.t2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserInfoController2 {
    @Autowired
    ApplicationEventPublisher applicationEventPublisher;

    @RequestMapping("test/publish2")
    public void publish() {

        applicationEventPublisher.publishEvent(new UserInfo2("publish2","123456"));

    }
}
